home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Programming / MuManual / Autodocs / 680x0.doc < prev    next >
Text File  |  2000-03-29  |  6KB  |  205 lines

  1. TABLE OF CONTENTS
  2.  
  3. 680x0.library/--Background--
  4. 680x0.library/CPUType
  5. 680x0.library/FPUType
  6. 680x0.library/MMUType
  7. 680x0.library/SetFPUExceptions
  8.  
  9. 680x0.library/--Background--           680x0.library/--Background--
  10.  
  11.     PURPOSE
  12.  
  13.     This library is the generic processor support library for all
  14.     Amigas and all CPU types. Its purpose is to determinate which
  15.     CPU, FPU and MMU type is installed, and to load the processor
  16.     specific support code in form of the 68000.library, 
  17.     the 68010.library, the 68020.library, the 68030.library, the
  18.     68040.library or the 68060.library. It does not include CPU
  19.     specific code instead, but re-routes all its calls to the processor
  20.     specific library to allow CPU/FPU/MMU independent code. It loads
  21.     also the mmu.library on startup to install the MMU specific
  22.     functions.
  23.  
  24.     This library provides user-callable functions to determinate the
  25.     CPU/FPU and MMU type available. The results are more precise than
  26.     those that can be found in SysBase->AttnFlags. Furthermore, the
  27.     library controls the FPU exceptions.
  28.  
  29.     The 680x0.library is usually loaded by "SetPatch" on startup and
  30.     remains in the system. It then checks the available hardware and
  31.     loads the CPU and MMU specific drivers.
  32.  
  33.  
  34. 680x0.library/CPUType                  680x0.library/CPUType
  35.     
  36.     NAME
  37.     CPUType     -   return information about the available CPU
  38.  
  39.     SYNOPSIS
  40.     cpu = CPUType ( );
  41.  
  42.     char CPUType ( void );
  43.  
  44.     FUNCTION
  45.     This function returns a one-bit identifier about the available CPU.
  46.     It currently knows the 68000, 68010, 68020, 68030, 68040 and 
  47.     68060.
  48.  
  49.     INPUTS
  50.     none.
  51.  
  52.     RESULTS
  53.     The CPU type found. One of the following identifiers is returned:
  54.  
  55.     CPUTYPE_68000       /* a plain 68000*/
  56.     CPUTYPE_68010       /* a 68010  */
  57.     CPUTYPE_68020       /* a 68020  */
  58.     CPUTYPE_68030       /* a 68030  */
  59.     CPUTYPE_68040       /* a 68040  */
  60.     CPUTYPE_68060       /* a 68060  */
  61.  
  62.     NOTES
  63.     Unlike some third-party libraries, this result code will be correct
  64.     even for the 68060.
  65.  
  66.     BUGS
  67.     Does currently not support a PPC.
  68.  
  69.     SEE ALSO
  70.     libraries/680x0.h, exec/execbase.h
  71.  
  72. 680x0.library/FPUType                  680x0.library/FPUType
  73.     
  74.     NAME
  75.     FPUType     -   return information about the available FPU
  76.  
  77.     SYNOPSIS
  78.     fpu = FPUType ( );
  79.  
  80.     char FPUType ( void );
  81.  
  82.     FUNCTION
  83.     This function returns a one-bit identifier of the available FPU.
  84.     It currently knows the 68881, 68882 and the build-in FPUs of the
  85.     68040 and 68060.
  86.  
  87.     INPUTS
  88.     none.
  89.  
  90.     RESULTS
  91.     The FPU type found. One of the following identifiers is returned:
  92.  
  93.     FPUTYPE_NONE    /* no FPU available */
  94.     FPUTYPE_68881   /* the 68881 external FPU   */
  95.     FPUTYPE_68882   /* the advanced edition of this chip */
  96.     FPUTYPE_68040   /* the 68040 buildin FPU    */
  97.     FPUTYPE_68060   /* the 68060 buildin FPU    */
  98.  
  99.     NOTES
  100.     This function works differently than SysBase->AttnFlags. It will
  101.     return FPUTYPE_68040 or FPUTYPE_68060 if a 68040 or 68060 FPU is
  102.     in the system, regardless whether the processor support code has
  103.     been loaded and the 68881/68882 instructions can be emulated in
  104.     software. This should be checked in SysBase->AttnFlags, if 
  105.     required.
  106.  
  107.     BUGS
  108.     Does currently not support a PPC.
  109.  
  110.     SEE ALSO
  111.     libraries/680x0.h, exec/execbase.h
  112.  
  113. 680x0.library/MMUType                  680x0.library/MMUType
  114.  
  115.     NAME
  116.     MMUType - return the type of the MMU available in the system.
  117.  
  118.     SYNOPSIS
  119.     mmu = GetMMUType( );
  120.             
  121.  
  122.     char GetMMUType( void );
  123.  
  124.     FUNCTION
  125.     Returns an identifier for the MMU available in the system or
  126.     NUL in case no MMU is installed.
  127.  
  128.     INPUTS
  129.     none.
  130.  
  131.     RETURNS
  132.     a character identifying the MMU type:
  133.  
  134.     MUTYPE_NONE        no working MMU detected.
  135.     MUTYPE_68851        a 68020 system with an external 68851
  136.                 MMU.
  137.     MUTYPE_68030        a 68030 MMU.
  138.     MUTYPE_68040        the internal 68040 MMU.
  139.     MUTYPE_68060        the 68060 MMU.
  140.  
  141.     NOTES
  142.     This call is directly re-routed to the mmu.library GetMMUType()
  143.     call. If the mmu.library is not available, it will return
  144.     MUTYPE_NONE.
  145.  
  146.     The mmu library is smart enough to detect EC processors without a
  147.     working MMU, but the library does not detect multiple CPUs in the
  148.     system. (How?)
  149.  
  150.     BUGS
  151.  
  152.     SEE ALSO
  153.     libraries/680x0.h, mmu/mmubase.h
  154.  
  155. 680x0.library/SetFPUExceptions         680x0.library/SetFPUExceptions
  156.  
  157.     NAME
  158.     SetFPUExceptions    -   control the generation of FPU exceptions
  159.  
  160.     SYNOPSIS
  161.     oldflags = SetFPUExceptions ( flags , mask );
  162.     d0                d0     d1
  163.  
  164.     ULONG SetFPUExceptions ( ULONG , ULONG );
  165.  
  166.     FUNCTION
  167.     This function disables or enables various exceptions a MC68K
  168.     FPU might generate. The purpose of this function is mainly to
  169.     enable workarounds for badly written software.
  170.  
  171.     INPUTS
  172.     flags    -    A ULONG bit mask of the exceptions to disable. A
  173.             set bit disables the corresponding exception.
  174.     mask    -    A mask longword of the flags that are to be changed.
  175.             A set bit indicates that the corresponding bit in
  176.             flags mask is valid.
  177.  
  178.     The following bits are currently defined:
  179.  
  180.     FPUCtrlB_BSUN   0L      Disable the branch or set on unordered 
  181.                 exception.
  182.     FPUCtrlB_INEX   1L      Disable the inexact result exception.
  183.     FPUCtrlB_DIVZ   2L      Disable the divide by zero exception.
  184.     FPUCtrlB_UNFL   3L      Disable the underflow exception.
  185.     FPUCtrlB_OVFL   4L      Disable the overflow exception.
  186.     FPUCtrlB_SNAN   5L      Disable the signalling NAN exception.
  187.     FPUCtrlB_OPERR  6L      Disable the operand error.
  188.  
  189.     RESULTS
  190.     the old settings of the exception mask.
  191.  
  192.     NOTES
  193.     This function is directly re-routed to the CPU specific driver, i.e.
  194.     either the 68040, the 68060, the 68020 or the 68030.library. It
  195.     does not touch the FPU itself. If the driver is not available, or
  196.     does not allow the change the FPU exception mask, this procedure
  197.     does nothing and returns "0".
  198.  
  199.     BUGS
  200.  
  201.     SEE ALSO
  202.     libraries/68040.h, libraries/680x0.h,
  203.     the Motorola 68040 manual.
  204.  
  205.